#ifndef PHONELOGINWIDGET_H
#define PHONELOGINWIDGET_H

#include <QTimer>
#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QTimer>

class PhoneLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhoneLoginWidget(QWidget *parent = nullptr);

    void switchMode();

    // 发送验证码
    void sendVerifyCode();

    // 收到验证码后
    void sendVerifyCodeDone();

    // 验证码CD
    void countDown();

    // 提交按钮点击
    void submitBtnClicked();

    // 登录完成
    void phoneLoginDone(bool success, const QString& reason);

    // 注册完成
    void phoneRegisterDone(bool success, const QString& reason);
private:
    QLineEdit* phoneEdit;
    QPushButton* sendVerifyCodeBtn;
    QLineEdit* verifyCodeEdit;
    QLabel* titleLabel;
    QPushButton* submitBtn;
    QPushButton* switchModeBtn;
    QString currentPhoneNumber = "";

    //QTimer* timer;
    int cooldown = 30;

    bool isLoginMode = true;

signals:
};

#endif // PHONELOGINWIDGET_H
